package com.bcxj.apipassenger.controller;

import com.bcxj.apipassenger.remote.ServiceRoutePlanClient;
import com.bcxj.internalcommon.dto.RouteRecordDTO;
import com.bcxj.internalcommon.response.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * ClassName: RouteRecordController
 * Package: com.bcxj.apipassenger.controller
 * Description:
 *
 * @Author BCXJ
 * @Create 2025/4/25 14:34
 * @Version 1.0
 * @Since 1.0
 */
@RestController
@RequestMapping("/route-record")
public class RouteRecordController {

    @Autowired
    private ServiceRoutePlanClient routePlanClient;

    /**
     * 增添出行历史记录
     * @param routeRecordDTO
     * @return
     */
    @PostMapping("add")
    public ResponseResult addRouteRecord(@RequestBody RouteRecordDTO routeRecordDTO) {
        return routePlanClient.addRecord(routeRecordDTO);
    }


    /**
     * 查询用户的历史的出行选择数据
     * @return
     */
    @GetMapping("list")
    public ResponseResult list(Long userId) {
        return routePlanClient.list(userId);
    }

}
